<?php
include('top.php');
require_once('pasmy/dbwaarden.php');
if(empty($_SESSION['taal'])) {
	session_destroy();
		Header( "HTTP/1.1 301 Moved Permanently" );
		 
		Header( "Location: login.php" ); 
}
$mysql_id = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($db, $mysql_id);
$sql = "select * from chauffeurs order by lang";
if($_SESSION['login'] > "0") {
?>
<br /><br /><br />
<table width="60%" border="1" align="center" cellpadding="10">
<tr>
<td class="delsaux" colspan="5">Chauffeurs</td>
</tr>
<tr>
<td class="delsaux2">Nom</td>
<td class="delsaux2">Date de naissance</td>
<td class="delsaux2">Lieu de naissance</td>
<td class="delsaux2">N&deg; permis</td>
<td class="delsaux2">En service depuis</td>
</tr>

<?php
 
$res = mysql_query($sql, $mysql_id);
	while ($row = mysql_fetch_row($res)) {
		echo "<tr>
		<td><strong>$row[0]</strong></td>
		<td><strong>$row[2]</strong></td>
		<td><strong>$row[3]</strong></td>
		<td><strong>$row[4]</strong></td>
		<td><strong>$row[5]</strong></td>
		</tr>";
	}
}
else {
	
?>
<br /><br /><br />
<table width="80%" border="1" align="center" cellpadding="10">
<tr>
<td class="delsaux" colspan="7">Chauffeurs</td>
</tr>
<tr>
<td class="delsaux2">Nom</td>
<td class="delsaux2">Date de naissance</td>
<td class="delsaux2">Lieu de naissance</td>
<td class="delsaux2">N&deg; permis</td>
<td class="delsaux2">En service depuis</td>
<td class="delsaux2">Update</td>
<td class="delsaux2">Delete</td>
</tr>

<?php
 
$res = mysql_query($sql, $mysql_id);
	while ($row = mysql_fetch_row($res)) {
		echo "<tr>
		<td><strong>$row[0]</strong></td>
		<td><strong>$row[2]</strong></td>
		<td><strong>$row[3]</strong></td>
		<td><strong>$row[4]</strong></td>
		<td><strong>$row[5]</strong></td>
		<td class='delsaux'><strong><a href='chweg.php?nr=$row[7]&optie=1'>update</a></strong></td>
		<td class='delsaux'><strong><a href='chweg.php?nr=$row[7]&optie=2'>delete</a></strong></td>
		</tr>";
	}	 
}
?>


</table>
 

<?php
include('footer.php');
?>